const Sequelize = require('sequelize')
let config = {
  host: 'localhost',
  user: 'yzaf',
  password: 'yzaf',
  database: 'design'
}
if (process.env.NODE_ENV === 'production') {
  config = {
    host: '10.10.6.40',
    user: 'yzaf',
    password: 'yzaf',
    database: 'design'
  }
}
const sequelize = new Sequelize(config.database, config.user, config.password, {
  host: config.host,
  dialect: 'mysql',
  operatorsAliases: false,
  timezone: '+08:00',
  pool: {
    max: 5,
    min: 0,
    acquire: 30000,
    idle: 10000
  }
})
module.exports = sequelize
